﻿<shared:PageBase x:Class="Miris.HumanMilkAnalyser.WPF.UnassignedSampleNumberListPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:shared="clr-namespace:Miris.HumanMilkAnalyser.WPF.Shared"
      xmlns:userControl="clr-namespace:Miris.HumanMilkAnalyser.WPF.CustomizedUserControl" 
      x:Name="CurrentPage"
      mc:Ignorable="d" 
      d:DesignHeight="580" d:DesignWidth="1160"
	  Title="UnassignedSampleNumberListPage" Style="{StaticResource DefaultPageStyle}" 
      DataContext="{Binding UnassignedSampleNumberList, Source={StaticResource Locator}}">
    <Page.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Skins/Storyboard/PageStoryborad.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Page.Resources>
    <Grid HorizontalAlignment="Center">
        <Grid.ColumnDefinitions>
            <!-- Back Button -->
            <ColumnDefinition Width="Auto" />
            <!-- Main Content -->
            <ColumnDefinition Width="Auto" />
            <!-- Next Button -->
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <Button Margin="0,0,30,0" Width="47" Tag="/Skins/Resource/Image/Back.png" Style="{StaticResource OpacityImageButton}" Click="ButtonReturn_Click" />
        <!-- Trasparent effect Background -->
        <Border Grid.Column="1" Style="{StaticResource PageContentContainerBorder}">
            <Border Style="{StaticResource PageContentBackgroundBorder}" />
        </Border>
        <Grid Grid.Column="1" Width="1050" Height="550">
            <Grid.RowDefinitions>
                <!-- Page Title -->
                <RowDefinition Height="55" />
                <!-- Patient Info -->
                <RowDefinition />
            </Grid.RowDefinitions>
            <TextBlock Text="未分配样本号" Margin="0,15,40,0" HorizontalAlignment="Center" Style="{StaticResource PageTitleTextBlock}" />
            <Grid Grid.Row="1" Margin="20,0,20,0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <!-- Test Date Label -->
                        <ColumnDefinition Width="Auto" />
                        <!-- Test Date Picker -->
                        <ColumnDefinition Width="Auto" />
                        <!-- CheckBox Label -->
                        <ColumnDefinition Width="120" />
                        <!-- CheckBox -->
                        <ColumnDefinition Width="Auto" />
                        <!-- Delete & Search Buttons -->
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="测试日期：" VerticalAlignment="Center" Style="{StaticResource WhiteTextBlock}" />
                    <StackPanel Grid.Column="1" Orientation="Horizontal">
                        <userControl:DatePickerUserControl Width="158" SelectedDate="{Binding StartDate}" />
                        <TextBlock Text=" - " VerticalAlignment="Center" Style="{StaticResource WhiteTextBlock}" />
                        <userControl:DatePickerUserControl Width="158" SelectedDate="{Binding EndDate}" />
                    </StackPanel>
                    <TextBlock Grid.Column="2" Text="完成测试：" VerticalAlignment="Center" HorizontalAlignment="Right" Visibility="Hidden" Style="{StaticResource WhiteTextBlock}" />
                    <CheckBox Grid.Column="3" Style="{StaticResource GreenCheckBoxStyle}" Visibility="Hidden" />
                    <StackPanel Grid.Column="4" Orientation="Horizontal" Grid.ColumnSpan="2" HorizontalAlignment="Right">
                        <Button Width="35" Tag="/Skins/Resource/Image/Search.png" 
                                Style="{StaticResource OpacityImageButton}" ToolTip="检索"
                                Command="{Binding SearchCommand}" 
                                CommandParameter="{Binding SelectedValue.Tag, ElementName=SelectedDataTypeComoBox}" />
                        <Button Width="40" Margin="10,0,0,0" Tag="/Skins/Resource/Image/Delete.png" ToolTip="删除未分配样本号"
                                Command="{Binding DeleteUnassignedSampleNumberCommand}" CommandParameter="{Binding SelectedItems, ElementName=DataGridUnassignedSampleNumbers}"
                                Style="{StaticResource OpacityImageButton}" />
                    </StackPanel>
                </Grid>
                <DataGrid x:Name="DataGridUnassignedSampleNumbers" Grid.Row="1" Margin="0,10,10,0" 
                              SelectedItem="{Binding SelectedPatient, Mode=OneWayToSource}"
                              ColumnHeaderStyle="{StaticResource DefaultDataGridColumnHeader}"
                              ItemsSource="{Binding UnassignedSampleNumberList}">
                    <DataGrid.Resources>
                        <SolidColorBrush Color="LightBlue" x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" />
                    </DataGrid.Resources>
                    <DataGrid.Columns>
                        <DataGridTextColumn Width="80" Header="顺序号" Binding="{Binding SequenceNumber}" />
                        <DataGridTextColumn Width="170" Header="未分配样本号" Binding="{Binding SampleNumber}" />
                        <DataGridTextColumn Width="170" Header="生成日期" Binding="{Binding GenerateDateDisplay}" />
                    </DataGrid.Columns>
                </DataGrid>
            </Grid>
        </Grid>
        <Button Grid.Column="2" Margin="30,0,0,0" Width="47" Tag="/Skins/Resource/Image/Next.png" Style="{StaticResource OpacityImageButton}" Visibility="Hidden" />
    </Grid>
</shared:PageBase>
